class Animal(object):
    def shout(self):
        print("动物会叫")


class Cat(Animal):
    def shout(self):
        print("小猫喵喵喵")


class Dog(Animal):
    def shout(self):
        print("小狗汪汪汪")


# 定义一个统一的接口，一个接口多种实现
def test(obj):
    obj.shout()


if __name__ == '__main__':
    cat = Cat()
    cat.shout()
    dog = Dog()
    dog.shout()

    # 统一接口测试
    test(cat)
    test(dog)
    test(Animal())